//
//  HGLargeNormalCollectionViewCell.m
//  悦享
//
//  Created by dllo on 16/3/19.
//  Copyright © 2016年 张洪国. All rights reserved.
//

#import "HGLargeNormalCollectionViewCell.h"
#import <UIImageView+WebCache.h>


@implementation HGLargeNormalCollectionViewCell

- (instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        
        self.imageView1 = [[UIImageView alloc] init];
        [self.contentView addSubview:_imageView1];
        
        self.iconImageView = [[UIImageView alloc] init];
        [self.contentView addSubview:_iconImageView];
        
        
        self.nameLabel = [[UILabel alloc] init];
        [self.contentView addSubview:_nameLabel];
        
        self.textLabel11 = [[UILabel alloc] init];
        [self.contentView addSubview:_textLabel11];
        
        
    }
    return self;
}

- (void)setArr:(NSMutableArray *)arr{
    _arr = arr;
    
    TVModel *mdoel = [_arr firstObject];
    
    [_imageView1 sd_setImageWithURL:[NSURL URLWithString:mdoel.picUrl] placeholderImage:[UIImage imageNamed:PLACE_HLODER]];
    
    _nameLabel.text = mdoel.name;
    _textLabel11.text = mdoel.desc;
    
    
    [_iconImageView sd_setImageWithURL:[NSURL URLWithString:mdoel.icon] placeholderImage:[UIImage imageNamed:PLACE_HLODER]];
    
    
}

- (void)applyLayoutAttributes:(UICollectionViewLayoutAttributes *)layoutAttributes{
    _imageView1.frame = CGRectMake(0, 0, layoutAttributes.frame.size.width, layoutAttributes.frame.size.height - 50);
    _imageView1.layer.cornerRadius = 0;
    _imageView1.layer.masksToBounds = YES;
    
    _iconImageView.frame = CGRectMake(0, 0, 50, 40);
    
    _nameLabel.frame = CGRectMake(5, layoutAttributes.frame.size.height - 55, 160, 30);
    _nameLabel.font = [UIFont systemFontOfSize:13];
    
    _textLabel11.frame = CGRectMake(5, layoutAttributes.frame.size.height - 40, layoutAttributes.frame.size.width - 10, 30);
    _textLabel11.font = [UIFont systemFontOfSize:10];
    _textLabel11.numberOfLines = 2;
}


@end
